package com.dabai.applicationmanager.adapter;

import android.content.Context;
import android.content.pm.PackageManager;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dabai.applicationmanager.R;
import com.dabai.applicationmanager.bean.FreezerAppInfo;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

import me.zhanghai.android.appiconloader.AppIconLoader;

public class FreezerAdapter extends BaseQuickAdapter<FreezerAppInfo, BaseViewHolder> {

    private final AppIconLoader appIconLoader;

    public FreezerAdapter(ArrayList<FreezerAppInfo> freezerInfo, Context context) {
        super(R.layout.item_freezer, freezerInfo);
        this.context = context;
        pm = context.getPackageManager();
        appIconLoader = new AppIconLoader(130, true, context);

    }

    Context context;
    PackageManager pm;


    @Override
    protected void convert(@NotNull BaseViewHolder helper, @NotNull FreezerAppInfo freezeInfo) {


        helper.setText(R.id.textView1, freezeInfo.getName());
        helper.setImageBitmap(R.id.imageView, freezeInfo.getIcon());


    }


}
